import pyshark
#tshark
from Godzilla import *
cap = pyshark.FileCapture('gs.pcapng', display_filter="http.content_length")
# print(dir(cap[0].http))
tmp=[]
for c in cap:
    for i in c:
        try:
            if "<" not in i.file_data:
                tmp.append(i.file_data.encode())
        except:
            continue

decrypter = PHP_XOR_BASE64(pass_='password123', key='3c6e0b8a9c15224a')
for i in tmp:
    try:
        if b"pass" in i:
            data = decrypter.decrypt_req_payload(i)
        #print(data.decode('utf-8', 'ignore'))
            print(data)
        else:
            data = decrypter.decrypt_res_payload(i)
        #print(data.decode('utf-8', 'ignore'))
            print(data)
    except:
        continue